﻿using System;
using System.Collections.Generic;
using System.Linq;  
using System.Text;
using System.EnterpriseServices;

using context;
using entity;
using DatabaseObject;
using HR_Interface;

namespace HR_Implements
{
    public class EmployeeRemotingObject:MarshalByRefObject, IEmployeeRemotingObject
    {
        context.DataClasses1DataContext ctx = new DataClasses1DataContext();
        

        public List<EmployeeEntity> getAllEmployee()
        {
            var q = from e in ctx.Employees
                    select new EmployeeEntity()
                    {
                        VFirstName = e.vFirstName,
                        VLastName = e.vLastName,
                        CCity = e.cCity
                    };
            return q.ToList();
            throw new NotImplementedException();
        }

        public List<EmployeeEntity> SearchEmployeByQualification(string qual)
        {
            var q = from e in ctx.Employees
                    where e.vQualification == qual
                    select new EmployeeEntity()
                    {
                        VFirstName = e.vFirstName,
                        VLastName = e.vLastName,
                        CCity = e.cCity
                    };
            return q.ToList();
            throw new NotImplementedException();
        }
    }
}
